<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--Converted with LaTeX2HTML 96.1 (Feb 5, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->


<title>Encoder and Decoder</title>
<meta name="description" content="Encoder and Decoder">
<meta name="keywords" content="htmlatex">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<link rel="STYLESHEET" href="acm-00444_files/htmlatex.css">
</head><body bgcolor="#ffffff" lang="EN">
 <h1><br clear="all"><center><table bgcolor="#0060f0"><tbody><tr><td><b><font color="#c0ffff" size="5">&nbsp;<a name="SECTION0001000000000000000000">Encoder and Decoder</a></font>&nbsp;</b></td></tr></tbody></table></center></h1>
<p>
Being in charge of the computer department of the Agency of
International Espionage, you are asked to write a program that
will allow a spy to encode and decode their messages.
</p><p>
You can assume a spy's message is at most 80 characters long, and
it includes all the upper and lowercase letters of the alphabet
plus the space, and any of the following characters:
</p><p>
</p><pre>!  ,  .  :  ;  ?</pre>
<p>
The following is an ASCII table of the valid characters in a
message:
</p><p>
</p><pre>     "A"  65   "a"  97   " "  32
     "B"  66   "b"  98   "!"  33
      .         .        ","  44
      .         .        "."  46
      .         .        ":"  58
     "Y"  89   "y"  121  ";"  59
     "Z"  90   "z"  122  "?"  63</pre>
<p>
The algorithm that you should use to encode messages is to take
the ASCII value of each character in the message, starting with
the last character in the message and ending with the first
character in the message.  You should then add on to the coded
message this ASCII value written in reverse order.  For example,
if the ASCII value is 123, the encoded message should contain the
string "<tt>321</tt>".  There should be no spaces separating the numbers
in the encoded message.
</p><p>
</p><h2><font color="#0070e8"><a name="SECTION0001001000000000000000">Input and Output</a></font></h2>
<p>
The input file consists of one or more lines with a normal (not encoded) or encoded message each.
</p><p>
</p><p>
Output file must have the same number of lines with the corresponding encoded message or the decoded one, respectively.
</p><p>
</p><h2><font color="#0070e8"><a name="SECTION0001002000000000000000">Sample Input</a></font></h2>
<p>
</p><pre>abc
798999
Have a Nice Day !</pre>
<p>
</p><h2><font color="#0070e8"><a name="SECTION0001003000000000000000">Sample Output</a></font></h2>
<p>
</p><pre>998979
cba
332312179862310199501872379231018117927</pre>
<p>
</p></body></html>